home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 283_01 / window.c < prev    next >
C/C++ Source or Header  |  1988-12-07  |  820b  |  50 lines

  1. /* window.c -- 9/5/88, d.c.oshel
  2.    */
  3.  
  4. #include "vidinit.h"
  5.  
  6.  
  7. /* read current window dimensions */
  8. void getwindow( int *tx, int *ty, int *bx, int *by )
  9. {
  10.     *tx = lm;
  11.     *ty = tm;
  12.     *bx = rm;
  13.     *by = bm;
  14. }
  15.  
  16.  
  17. void setwindow( int tx, int ty, int bx, int by )
  18. {
  19.    if (bx > BTMX) bx = BTMX;
  20.    if (tx < TOPX) tx = TOPX;
  21.    if (by > BTMY) by = BTMY;
  22.    if (ty < TOPY) ty = TOPY;
  23.  
  24.    if (tx >= bx || ty >= by)  /* absurd values? set full screen reduced by 1 */
  25.    { 
  26.        putch(7); /* complain but continue */
  27.        lm = TOPX + 1; rm = BTMX - 1; tm = TOPY + 1; bm = BTMY - 1; 
  28.    } 
  29.    else
  30.    {
  31.        lm = tx;
  32.        rm = bx;
  33.        tm = ty;
  34.        bm = by;
  35.    }
  36. }
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43. void clrwindow( void )
  44. {
  45.     MSJ_ClrRegion( tm, lm, bm, rm, vid_attr );
  46.     gotoxy(0,0);
  47. }
  48.  
  49.  
  50.